Documentation > CMS Template API Library > Asset > ExecuteWorkflowCommand(List[Int32],String,Boolean)

ExecuteWorkflowCommand

Execute the specified workflow command on the given list of assets. The workflow command must be available from the current state of each asset in the list. If one asset fails, the method continues on the rest of the list. ACL for executing workflow commands are respected. Workflow filters for that particular workflow command are respected.

public CrownPeak.CMSAPI.ExecuteWorkflowCommandResponse ExecuteWorkflowCommand(List[Int32],String,Boolean)


Returns

ExecuteWorkflowCommandResponse.

Parameters

NameDescriptionType
assetIds The list of asset Ids on which the workflow command should be executed. List<Int32>
commandName The name of the workflow command. Not case sensitive. System.String
skipDependencies (Optional) Applies only when workflow results in a publish. If false, dependencies will be computed and published if necessary. Defaults to false. System.Boolean

Code Example

C#

Sample:
// Move the asset to the workflow step that has status set to "LIVE".
ExecuteWorkflowCommandResponse resp = Asset.ExecuteWorkflowCommand(myAssetIds, "Deploy to Live");
if (resp.HasError)
{
  Out.WriteLine("ExecuteWorkflowCommand failed: " + resp.ErrorMessage);
}

Connect with Crownpeak